package cn.edu.zafu.bigdata.x.zhaobolei.Forth;

public class Cube {
    private double length;
    private double width;
    private double height;

    public Cube(double length, double width, double height) {
        this.length = length;
        this.width = width;
        this.height = height;
    }

    public double getLength() {
        return length;
    }

    public double getWidth() {
        return width;
    }

    public double getHeight() {
        return height;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }

        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }

        Cube other = (Cube) obj;

        return Double.compare(this.length, other.length) == 0 &&
                Double.compare(this.width, other.width) == 0 &&
                Double.compare(this.height, other.height) == 0;
    }
}
